package HomeWork05;

/**
 * @author 李孟琦
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: HomeWork05
 * @ClassName: 005
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/10/9 16:09
 * @Copyright 李孟琦版权所有
 */
public class Student {
    //5.1、把Student 的属性都作为私有，并提供getter/setter 方法以及适当的构造方法。
    //2、为Student 类添加一个getPostAddress 方法，要求返回Student 对象的地址和邮编

    private String name;
    private int age;
    private String address;
    private String zipCode;
    private String mobile;

    public Student() {

    }

    public Student(String name, int age, String address, String zipCode, String mobile) {
        this.name = name;
        this.age = age;
        this.address = address;
        this.zipCode = zipCode;
        this.mobile = mobile;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getPostAddress() {
        String msg = "该学生的地址与邮编为:\n";
        msg += "地址:" + this.getAddress() + ",邮编为:" + this.getZipCode();
        return msg;
    }


}

